<?php
/*
 * @Description    : Base
 * @Version        : 1.0.0
 * @Author         : QianLong
 * @Date           : 2022-03-25 17:27:41
 * @LastEditors    : QianLong
 * @LastEditTime   : 2022-03-25 17:30:51
 */

namespace Ecmpay\Ecmpay;

use Ecmpay\Ecmpay\ecmpay\alipay;
use Ecmpay\Ecmpay\ecmpay\wxpay;

class Base
{
    protected static $config = [];
    protected static $lib;
    protected static $ecmUrl = 'https://openapi.ecmpay.cn/';
    protected static $alipay;
    protected static $wxpay;
    public static function init($userConfig)
    {
        if (!isset($userConfig['appSecret']) || empty($userConfig['appSecret'])) {
            throw new \Exception("初始化配置中缺少应用私钥: appSecret");
        }
        self::$config = $userConfig;
        self::$lib = new Lib;
        self::$alipay = new alipay;
        self::$wxpay = new wxpay;
    }
}
